package com.hdq.mapper;

import com.github.pagehelper.Page;
import com.hdq.annotation.AutoFill;
import com.hdq.annotation.ManagerName;
import com.hdq.enumeration.OperationType;
import entity.Skus;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import vo.SkusPageVO;

import java.util.List;

@Mapper
public interface SkusMapper {

    Page<SkusPageVO> selectByPage();



    // 插入新的 SKU
    @Insert("insert into skus (name, type, create_time, update_time, create_manager_id, last_update_manager_id, status, `order`, standards) values (#{name},#{type},#{createTime},#{updateTime},#{createManagerId},#{lastUpdateManagerId},#{status},#{order},#{standards})")
    @AutoFill(OperationType.INSERT)
    @ManagerName(OperationType.INSERT)
    void insert(Skus skus);

    void delete(List<Long> ids);
    @AutoFill(OperationType.UPDATE)
    @ManagerName(OperationType.UPDATE)
    void update(Skus skus);
}
